package us.icitap.cm.business.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Id;
import javax.persistence.JoinColumn;

@Embeddable
public class ControlAppEntityFoundId implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -1996898972303016917L;

	@Id
	@Column(name="CONTROL_ID", insertable=false, updatable=false)
	private Integer controlId;
	
	@Id
	@Column(name="APP_ENTITY_ID", insertable=false, updatable=false)
	private Integer appEntityId;

	public Integer getControlId() {
		return controlId;
	}

	public void setControlId(Integer controlId) {
		this.controlId = controlId;
	}

	public Integer getAppEntityId() {
		return appEntityId;
	}

	public void setAppEntityId(Integer appEntityId) {
		this.appEntityId = appEntityId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((appEntityId == null) ? 0 : appEntityId.hashCode());
		result = prime * result
				+ ((controlId == null) ? 0 : controlId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ControlAppEntityFoundId other = (ControlAppEntityFoundId) obj;
		if (appEntityId == null) {
			if (other.appEntityId != null)
				return false;
		} else if (!appEntityId.equals(other.appEntityId))
			return false;
		if (controlId == null) {
			if (other.controlId != null)
				return false;
		} else if (!controlId.equals(other.controlId))
			return false;
		return true;
	}
	
	
	
}
